#include "background.h"
#include<QPixmap>
#include<QTimer>
#include<QPropertyAnimation>

//QList<int> Y = {0,220,320};

const int speed = 200;

background::background(QObject *parent)
    : QObject(parent),QGraphicsPixmapItem(QPixmap(":/res/bg.png"))
{
    setPos(0,0);
    move = new QPropertyAnimation(this, "pos");
    move->setStartValue(QPointF(0,0));
    move->setEndValue(QPointF(-720,0));
    move->setDuration(720 * 1000/speed );
    move->setLoopCount(-1);
    move->start();
}

void background::setPos1(const QPointF &pos)
{
   // m_pos = pos;
    //this->setPos(m_pos);
}



